package com.fone.player.play;

import com.fone.player.play.impl.AirOnePauseState;
import com.fone.player.play.impl.AirOnePlayState;
import com.fone.player.play.impl.FullScreenInitalState;
import com.fone.player.play.impl.FullScreenPauseState;
import com.fone.player.play.impl.FullScreenPlayState;
import com.fone.player.play.impl.InitialState;
import com.fone.player.play.impl.SmallScreenPauseState;
import com.fone.player.play.impl.SmallScreenPlayState;

/**
 * 播放器状态机,包含播放器各种状态、处理流程
 * 
 * @author kongxiaojun
 * @since 2014-4-25
 */
public class PlayerStateMachine {

	private IPlayerState initial;
	private IPlayerState fullInitial;
	private IPlayerState smallPlay;
	private IPlayerState smallPause;
	private IPlayerState fullPlay;
	private IPlayerState fullPause;
	private IPlayerState aironePlay;
	private IPlayerState aironePause;

	private IPlayerState currentState;

	public PlayerStateMachine() {

		this.initial = new InitialState(this);
		this.smallPause = new SmallScreenPauseState(this);
		this.smallPlay = new SmallScreenPlayState(this);
		this.fullPlay = new FullScreenPlayState(this);
		this.fullPause = new FullScreenPauseState(this);
		this.aironePlay = new AirOnePlayState(this);
		this.aironePause = new AirOnePauseState(this);
		this.fullInitial = new FullScreenInitalState(this);

		this.currentState = initial;

	}
	

	public IPlayerState getFullInitial() {
		return fullInitial;
	}



	public void setFullInitial(IPlayerState fullInitial) {
	
		this.fullInitial = fullInitial;
	}



	public IPlayerState getInitial() {
		return initial;
	}

	public void setInitial(IPlayerState initial) {

		this.initial = initial;
	}

	public IPlayerState getSmallPlay() {
		return smallPlay;
	}

	public void setSmallPlay(IPlayerState smallPlay) {

		this.smallPlay = smallPlay;
	}

	public IPlayerState getSmallPause() {
		return smallPause;
	}

	public void setSmallPause(IPlayerState smallPause) {

		this.smallPause = smallPause;
	}

	public IPlayerState getFullPlay() {
		return fullPlay;
	}

	public void setFullPlay(IPlayerState fullPlay) {
		this.fullPlay = fullPlay;
	}

	public IPlayerState getFullPause() {
		return fullPause;
	}

	public void setFullPause(IPlayerState fullPause) {
		this.fullPause = fullPause;
	}

	public IPlayerState getAironePlay() {
		return aironePlay;
	}

	public void setAironePlay(IPlayerState aironePlay) {

		this.aironePlay = aironePlay;
	}

	public IPlayerState getAironePause() {
		return aironePause;
	}

	public void setAironePause(IPlayerState aironePause) {
		this.aironePause = aironePause;
	}

	public IPlayerState getCurrentState() {
		return currentState;
	}

	public void setCurrentState(IPlayerState currentState) {
		this.currentState = currentState;
	}

	public boolean play() {
		return currentState.play();
	}

	public boolean pause() {
		return currentState.pause();
	}
	
	public boolean stop(){
		return currentState.stop();
	}

	public boolean changOrientationToLand() {
		return currentState.changOrientationToLand();
	}

	public boolean changOrientationToPort() {
		return currentState.changOrientationToPort();
	}

	public boolean airone_play(){
		return currentState.airone_play();
	}

	public boolean airone_pause() {
		return currentState.airone_pause();
	}

	public boolean airone_stop() {
		return currentState.airone_stop();
	}

}
